import matplotlib.pyplot as plt

# Values for the new bars to be created
new_values = [0.502, 0.7723076923076924, 0.8715277777777778, 0.9471698113207547, 0.9507575757575758, 0.9653846153846154, 1, 1]
new_labels = ["Random Forest", "Jaccard", "Cosine", "N-Gram", "GPT (temp:1.0)", "GPT (temp:0.2)", "GPT (temp:1.0,p1)", "GPT (temp:0.2, p2)"]

# Creating a new bar chart with nice colors and filled bars
plt.figure(figsize=(15, 6))
bars = plt.bar(new_labels, new_values, color=['#3498db', '#2ecc71', '#e74c3c', '#9b59b6', '#f1c40f', '#e67e22', '#1abc9c', '#34495e'])

# Adding values on top of each bar
for bar in bars:
    yval = bar.get_height()
    plt.text(bar.get_x() + bar.get_width()/2, yval + 0.01, round(yval, 3), ha='center', va='bottom')

plt.title('Experiment 2: Incumbent Voting', fontsize=15, fontweight='bold')
plt.ylabel('Precision @ Recall = 1')

# Adjusting the plot to display everything nicely
plt.tight_layout(pad=3.0)
plt.savefig("figure_2.pdf")

# Displaying the created bar chart
plt.show()

